#ifndef BOARD_H
#define BOARD_H
#include <vector>
#include <iostream>
using namespace std;
class BoardViewer;
enum Color{Empty = 0, White, Black, Fense};
enum MoveResult{Unsuccessful = 0, Successful};
class Board
{
public:
    Board();
    void add_viewer(BoardViewer* bv);
    const Color& operator()(int r, int c)const{
        return b_[r][c];
    }
    MoveResult get_possible_move(Color, int& r, int& c)const;
    int score(Color color)const;
    MoveResult valid_move(Color color, int r, int c)const;
    void move(Color color, int r, int c) ;
    enum{ROWS = 8, COLS = 8};
    friend ostream& operator <<(ostream& os, const Board& board);
private:
    Color b_[ROWS+2][COLS+2];
    int black_score_, white_score_;
    std::vector<BoardViewer*> viewers_;
    void update_viewers(int row, int col, Color color);
};
Color opponent_of(Color color);
ostream& operator <<(const ostream& os, const Board& board);
#endif

    
    
    

